package com.audaque.springboot.foshanupload.web.springsecuritycas.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.cas.ServiceProperties;

/**
 * @author zgb
 * @desc 客户端配置
 * @date 2022-12-17 15:32:41
 */
@Configuration
public class ServiceWebSecurityBeanConfig {


    @Autowired
    private CasServerConfig casServerConfig;

    @Autowired
    private CasServiceConfig casServiceConfig;

    @Bean
    public ServiceProperties serviceProperties() {
        ServiceProperties serviceProperties = new ServiceProperties();
        serviceProperties.setService(
                this.casServiceConfig.getWebHost() + this.casServiceConfig.getLogin()); //回跳地址
        serviceProperties.setSendRenew(this.casServiceConfig.getSendRenew());//是否敏感，即登录不同的应用系统是否还要重新登录
        serviceProperties.setAuthenticateAllArtifacts(false); //是否对没有ticket的访问需要验证
        return serviceProperties;
    }


}
